<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
  <meta http-equiv="content-type" content="text/html; charset=windows-1250">
  <meta name="generator" content="PSPad editor, www.pspad.com">
  <title>Simple RESTful DDS tester</title>
  </head>
  <body>
    

    <h1>Simple RESTful DDS tester</h1>
    <p>Enter the URI that you want to test and select one of the HTTP methods
       to send to that URI. Click the button to execute the request. The
       result(s) will be shown below the ruler.</p>
    <form name="myForm" onsubmit="executeRequest(); return false;">
      URI: <input id="uriInput" size="100" type="text"/><br>
      Method: <select id="methodInput">
          <option selected>GET</option>
          <option>PUT</option>
          <option>POST</option>
          <option>DELETE</option>
      </select>
      <input type="submit" value="Send"/>
    </form>
    <hr>
    <div id="message">No message received yet</div>
    <div id="result">No results received yet</div>

    <!-- JavaScript functions to execute requests and update values -->
    <script type="text/javascript">
      function setResult(newValue) {
        element = document.getElementById("result");
        element.firstChild.textContent = newValue;
      }
      
      function setMessage(newValue) {
        element = document.getElementById("message");
        element.firstChild.textContent = newValue;
      }
      
      
      function fillResult() {
        if (request.readyState != 4)
          return;
        setMessage('Request complete:');
        setResult(request.responseText);
      }

      function executeRequest() {
        var uriElement = document.getElementById('uriInput');
        var methodElement = document.getElementById('methodInput');
        setMessage('Building request... for ' + uriElement.value);
        request = new XMLHttpRequest();
        //request.open("GET", "http://localhost:8182/dds/Hoi/HisPartition/PointTrack_topic/track%3A%3APointTrack/subscribe/testreader/take", false);
        //request.open(methodValue, uriValue, true);
        request.open(methodElement.value, uriElement.value, true);
        request.onreadystatechange = fillResult;
        request.send(null);
        setResult('waiting for response...' + methodElement.value);
      }
    </script>


  </body>
</html>
